package com.open.party.cloud.view.examine

import android.os.Bundle
import cn.android.x.parent.AppTitleBaseActivity
import com.open.party.cloud.R
import com.open.party.cloud.model.ExamineBean
import com.sinothk.android.utils.XUtils
import kotlinx.android.synthetic.main.examine_detail_activity.*

class ExamineDetailActivity : AppTitleBaseActivity() {

    var bean: ExamineBean? = null

    override fun getLayoutResId(): Int = R.layout.examine_detail_activity

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setViewTitle("考试详情")
        bean = intent.getSerializableExtra("bean") as ExamineBean

        showView(bean!!)
    }

    private fun showView(bean: ExamineBean) {
        titleTv.text = XUtils.string().getNotNullValue(bean.name)

        scoreTv.text = "${bean.score}分"
        jiFenTv.text = bean.integral.toString()

        timeTv.text = "${bean.lengthOfExamination}分钟"
        numTv.text = bean.subjectNumber.toString()

        val timeStartStr = XUtils.date().getDateStrByDate(bean.signTime, "yyyy-MM-dd HH:mm")
        val timeEndStr = XUtils.date().getDateStrByDate(bean.endTime, "yyyy-MM-dd HH:mm")
        dateTimeTv.text = "$timeStartStr - $timeEndStr"

        examineDescTv.text = XUtils.string().getNotNullValue(bean.briefIntroduction)

    }
}